"use client";
import { useGlobalLoadingStore } from "@/lib/globalLoadingStore";

export default function GlobalLoading() {
  const loading = useGlobalLoadingStore((s) => s.loading);
  if (!loading) return null;
  return (
    <div className="fixed inset-0 z-[9999] flex items-center justify-center bg-black/40">
      <div className="flex flex-col items-center">
        <div className="animate-spin rounded-full h-12 w-12 border-b-4 border-blue-500 mb-4" />
        <span className="text-white text-lg font-semibold">加载中...</span>
      </div>
    </div>
  );
}
